home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 2010 April
/
PCWorld0410.iso
/
pluginy Firefox
/
1122
/
1122.xpi
/
chrome
/
tabmixplus.jar
/
content
/
tabmixplus
/
pref
/
preferencesOverlay.js
< prev
next >
Wrap
Text File
|
2009-08-30
|
3KB
|
83 lines
var gTabMix_preferencesOverlay = {
init: function gTabMix_preferencesOverlay_init(aEvent) {
var prefWindow = aEvent.target.documentElement;
this.onPaneLoad(prefWindow.lastSelected);
eval("prefWindow.showPane ="+prefWindow.showPane.toString().replace(
'this._outer._selectPane(this._pane);',
'$& \
gTabMix_preferencesOverlay.onPaneLoad(this._pane.id);'
));
},
onPaneLoad: function gTabMix_preferencesOverlay_onPaneLoad(aPaneID) {
switch (aPaneID) {
case "paneTabs":
this.loadOverlay();
break;
case "panePrivacy":
this.onPanePrivacyLoad();
break;
default:
}
},
/* ........ paneTabs .............. */
loadOverlay: function () {
function OverlayLoadObserver() { }
OverlayLoadObserver.prototype = {
_outer: this,
observe: function (aSubject, aTopic, aData) {
this._outer._afterOverlayLoaded();
}
};
var obs = new OverlayLoadObserver();
document.loadOverlay("chrome://tabmixplus/content/pref/tab_panel.xul", obs);
},
_afterOverlayLoaded: function () {
document.getElementById("_hideTabbar").value = document.getElementById("extensions.tabmix.hideTabbar").value;
document.getElementById("generalWindowOpen").value = document.getElementById("browser.link.open_newwindow").value;
var prfSV = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch2);
var singleWindowMode = prfSV.getBoolPref("extensions.tabmix.singleWindow");
if (singleWindowMode)
document.getElementById("linkTargetWindow").disabled = true;
if (document.getElementById('BrowserPreferences')._shouldAnimate)
window.sizeToContent();
},
showTabmixOptions: function () {
var windowMediator = Components.classes["@mozilla.org/appshell/window-mediator;1"]
.getService(Components.interfaces.nsIWindowMediator);
var browserWindow = windowMediator.getMostRecentWindow('navigator:browser');
if (!browserWindow) {
var tabmixopt = windowMediator.getMostRecentWindow("mozilla:tabmixopt");
if (tabmixopt)
tabmixopt.close();
var stringBundle = Components.classes["@mozilla.org/intl/stringbundle;1"]
.getService(Components.interfaces.nsIStringBundleService)
.createBundle("chrome://tabmixplus/locale/tabmix.properties");
var title = stringBundle.GetStringFromName("tabmixoption.error.title");
var msg = stringBundle.GetStringFromName("tabmixoption.error.msg");
var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
.getService(Components.interfaces.nsIPromptService);
promptService.alert(window, title, msg);
}
else
browserWindow.TMP_openDialog(-1);
},
/* ........ panePrivacy .............. */
onPanePrivacyLoad: function () {
var clearDataNow = document.getElementById("clearDataNow");
if (clearDataNow)
clearDataNow.setAttribute("oncommand", clearDataNow.getAttribute("oncommand") + " TMP_Sanitizer.tryToSanitize();");
}
}